/
docker-compose.test.yml
71 lines (66 loc) · 1.99 KB
/
docker-compose.test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
version: '3'
services:
client-test:
image: {{ cookiecutter.project_slug }}_client # use client image from docker-compose.yml
environment:
- API_SERVER_URL=http://server-test:8001 # use server-test port
- API_GRAPHQL_SERVER_URL=http://server-test:8001/api/graphql # use server-test port
- API_CSRFTOKEN_URL=http://server-test:8001/admin # use server-test port
volumes:
- ./client:/app
- /app/node_modules
- /app/build
- /app/public
- schema-test:/app/schema # Need to keep schema up to date based off of server
- /app/src/generated/ # Don't want to overwrite what's generated via
# the non-test environment.
depends_on:
- server-test
# Should be same as server in docker-compose.yml below this point
command: npm run start
tty: true
stdin_open: true
ports:
- 8081:8080
server-test:
build:
context: ./server
command:
- /bin/bash
- -c
- |
./wait-for.sh database:5432
python manage.py migrate
python manage.py graphql_schema
python manage.py runserver 0.0.0.0:8001
depends_on:
- database
- redis
volumes:
- ./server:/app
- schema-test:/app/schema # Need to keep schema up to date based off of server
env_file:
- ./server/.env
environment:
SENTRY_DSN: ${SENTRY_DSN}
DJANGO_ALLOWED_HOSTS: localhost,server-test
DJANGO_CORS_ORIGIN_WHITELIST: http://localhost:8081,http://client-test:8080
DJANGO_TRUSTED_ORIGINS: http://localhost:8081,http://client-test:8080
DJANGO_DISABLE_CSRF: 'True'
tty: true
stdin_open: true
ports:
- 8001:8001
cypress:
image: "cypress/included:3.8.3"
depends_on:
- client-test
- server-test
environment:
- CYPRESS_baseUrl=http://client-test:8080
- CYPRESS_SERVER_GRAPHQL_URL=http://server-test:8001/api/graphql
working_dir: /e2e
volumes:
- ./e2e:/e2e
volumes:
schema-test: